<?php

include_once $_SERVER['DOCUMENT_ROOT'] . '/functions/password/bdd.php';
include_once $_SERVER['DOCUMENT_ROOT'] . '/functions/bdd/avion/donnees.php';
include_once $_SERVER['DOCUMENT_ROOT'] . '/functions/bdd/avion/etapes.php';
include_once $_SERVER['DOCUMENT_ROOT'] . '/functions/bdd/avion/photos.php';
include_once($_SERVER['DOCUMENT_ROOT'] . "/functions/affichage/details.php");

if (isset($_GET["id"])) {
    $pdo_options[PDO::ATTR_ERRMODE] = PDO::ERRMODE_EXCEPTION;
    $bdd = new PDO('mysql:host=localhost;dbname=origavion', 'origavion', get_bdd_password(), $pdo_options);

    $donnee = get_avion_donnees($_GET['id']);
    $etapes = get_avion_etapes($_GET['id']);
    $images = get_avion_photos($_GET['id']);

    affdetails($donnee, $etapes, $images);
} else {
    exit('<div class = "underline">Pour acceder a cette page, il faut passer par un lien</div>.');
}
?>